package com.heys.demo;


import java.util.Arrays;

public class App {

    public static void main(final String[] args) {
        Integer[] list = {3,9,4};
        list = sort(list);

        System.out.println(Arrays.asList(list));

    }
    public static Integer[] sort(final Integer[] args){
        int len = args.length-1;
        boolean sorted =false;
        while (!sorted){
            sorted = true;
            for(int i=0;i<len;i++){
                if (args[i]>args[i+1]){
                    sorted = false;
                    final int temp = args[i];
                    args[i] = args[i+1];
                    args[i+1] = temp;
                }
            }
            len = len -1;
        }
        return args;
    }
}
